<?php $this->load->view('header'); ?>
 <div id="title_background">
	<div class="wrapper"><!-- 900px wrapper -->
		<h1>Galeri Photo</h1>
		<!--<span class="title_description">This is crossroads for features. Here you could describe your page or leave it blank.</span>-->
	</div> <!-- 900px wrapper -->
</div>
</div>
<div class="cleaner"></div>
<div id="position_navi"><a href="index.html">Beranda</a> / Photo</div>
<div id="content">
<!--<article>
<?php //if($user){ ?>
<a href="<?php //echo base_url()."photos/add";?>"><button class="button" style="width: auto!important">Unggah Foto Baru</button></a>
<?php //} ?>
</article>-->
<div id="data-foto">
<?php 
if(count($photos) > 0) {
	foreach ($photos as $photo){ ?>
	<article class="quarter photo">
		<a href="<?php echo base_url()."photos/detail/".$photo['id_foto'];?>"><img class="photo-img" src="<?php echo base_url() . PHOTO_PATH . $photo['foto'];?>" /></a>
		<h2 class="caps"><?php echo $photo['judul'];?></h2><span class="writer">Diunggah Oleh: <?php echo $photo['writer'];?></span>
		<p class="cek">Pada <?php echo timestamp_to_date_time($photo['waktu_posting']); ?></p>
	</article>
	<?php } 
}else{ 
	echo "<article><span>Tidak ada foto yang diunggah.<span></article>";
}?>
</div>
<div class="cleaner"></div>
<?php if(count($photos) > 0){ ?>
	<article class="sidebar_right" id="pagination"> </article>
<?php } ?>

<!--<article class="sidebar_right">
	<a href="#"><button class="pager active">1</button></a>
	<a href="#"><button class="pager">2</button></a>
	<a href="#"><button class="pager">3</button></a>
</article>-->

<div class="cleaner"></div>
</div>
<div class="cleaner"></div>
<?php $this->load->view('footer', $footer); ?>
<script type="text/javascript">
    $(document).ready(function () {
        $('#pagination').smartpaginator({ totalrecords: <?php echo count($photos); ?>, recordsperpage: 50, length: 5, datacontainer: 'data-foto', dataelement: 'article', initval: 0, next: 'Next', prev: 'Prev', first: 'First', last: 'Last'});
    });
</script>